package com.example.second.command;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.example.second.R;
import com.example.second.command.classes.Invoker;
import com.example.second.command.classes.LedOff;
import com.example.second.command.classes.LedOffCommand;
import com.example.second.command.classes.LedOn;
import com.example.second.command.classes.LedOnCommand;

public class CommandActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_command);

        LedOn ledOn = new LedOn();
        Invoker invoker = new Invoker();
        LedOnCommand ledOnCommand = new LedOnCommand(ledOn);
        invoker.setCommand(ledOnCommand);
        invoker.call();

        LedOff ledOff = new LedOff();
        LedOffCommand ledOffCommand = new LedOffCommand(ledOff);
        invoker.setCommand(ledOffCommand);
        invoker.call();
    }
}